package com.wjs.juc.volatiles;


import java.util.concurrent.TimeUnit;

public class VolatileDemo1 {
    static  boolean isStop=true;
    public static void main(String[] args) {
        new Thread(()->{
            while (isStop){
            }
            System.out.println("t1 线程停止");
        },"t1").start();
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
      isStop=false;
    }
}
